<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:o="http://openfaces.org/">

    <ui:composition template="/templatemnt.xhtml">
        <ui:define name="body">
            <h:form>
                <br/>
                <h:panelGrid columns="3" styleClass="panel">
                    <h:outputText value="#{bundle.EditShowtimeTitle}" styleClass="titulo"
                                  rendered="#{showtimeController.modo=='Edit'}">
                    </h:outputText>
                    <h:outputText value="#{bundle.CreateShowtimeTitle}" styleClass="titulo"
                                  rendered="#{showtimeController.modo=='Create'}">
                    </h:outputText>
                    <h:outputText value="#{bundle.ViewShowtimeTitle}" styleClass="titulo"
                                  rendered="#{showtimeController.modo=='View'}">
                    </h:outputText>
                    <h:outputText/>
                    <h:panelGrid columns="3" styleClass="panel_boton_m">
                        <h:messages id="msgs"
                                    errorStyle="color: red; background-color: #FF9797" 
                                    infoStyle="color: green; background-color: #99ff99 "/>
                        <h:commandButton rendered="#{showtimeController.modo!='View'}"
                                         action="#{showtimeController.confirma}" title="Save"
                                         image="/resources/img/guardar.png">
                        </h:commandButton>
                        <h:commandButton action="#{showtimeController.prepareList}" title="Cancel" 
                                         image="/resources/img/cancelar.png" immediate="true">
                        </h:commandButton>
                    </h:panelGrid>
                    <h:outputLabel value="#{bundle.EditShowtimeLabel_showtimeID}" for="showtimeID" />
                    <h:inputText id="showtimeID" value="#{showtimeController.selected.showtimeID}" 
                                 title="#{bundle.EditShowtimeTitle_showtimeID}" disabled="true"
                                 size="#{showtimeController.longCampo('showtimeID')}"/>
                    <h:outputText/>
                    <h:outputLabel value="#{bundle.EditShowtimeLabel_showDate}" for="showDate" />
                    <o:dateChooser id="showDate" value="#{showtimeController.selected.showDate}" label="#{bundle.EditShowtimeTitle_showDate}" 
                                   required="#{showtimeController.campoNulo('showDate')}"
                                   disabled="#{showtimeController.modo=='View'}">
                    </o:dateChooser>
                    <h:message for="showDate" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditShowtimeLabel_showTime}" for="showTime" />
                    <o:dateChooser id="showTime" value="#{showtimeController.selected.showTime}" label="#{bundle.EditShowtimeTitle_showTime}" 
                                   required="#{showtimeController.campoNulo('showTime')}"
                                   disabled="#{showtimeController.modo=='View'}">
                    </o:dateChooser>
                    <h:message for="showTime" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditShowtimeLabel_showtimePrice}" for="showtimePrice" />
                    <h:inputText id="showtimePrice" value="#{showtimeController.selected.showtimePrice}" 
                                 title="#{bundle.EditShowtimeTitle_showtimePrice}" 
                                 required="#{showtimeController.campoNulo('showtimePrice')}" 
                                 requiredMessage="#{bundle.EditShowtimeRequiredMessage_showtimePrice}"
                                 size="#{showtimeController.longCampo('showtimePrice')}"
                                 maxlength="#{showtimeController.longCampo('showtimePrice')}"
                                 disabled="#{showtimeController.modo=='View'}"/>
                    <h:message for="showtimePrice" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditShowtimeLabel_movieID}" for="movieID" />
                    <h:selectOneMenu id="movieID" value="#{showtimeController.selected.movieID}" title="#{bundle.EditShowtimeTitle_movieID}" 
                                     required="true" requiredMessage="#{bundle.EditShowtimeRequiredMessage_movieID}"
                                     disabled="#{showtimeController.modo=='View'}">
                        <f:selectItems value="#{moviesController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputText/>
                    <h:outputLabel value="#{bundle.EditShowtimeLabel_cinemaID}" for="cinemaID" />
                    <h:selectOneMenu id="cinemaID" value="#{showtimeController.selected.cinemaID}" title="#{bundle.EditShowtimeTitle_cinemaID}" 
                                     required="true" requiredMessage="#{bundle.EditShowtimeRequiredMessage_cinemaID}"
                                     disabled="#{showtimeController.modo=='View'}">
                        <f:selectItems value="#{cinemaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputText/>
                </h:panelGrid>
                <br />
            </h:form>
        </ui:define>
    </ui:composition>
</html>
